package com.atstudy.task;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @version v1.0
 * @description:
 * @author: admin
 * @date: 2023/2/20 12:51
 * @copyright: 博为峰
 */
@Component
public class AsyncTask {

    @Async("asyncThreadPoolTask")
    public void async() {
        try {
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(Thread.currentThread().getName());
    }
}
